
from app.make_thread import *
import clipboard


class ClipboadWatcher(object):

    def __init__(self, on_change=print):
        self.on_change = on_change

    @make_thread
    def watch(self):
        tmp = clipboard.paste()
        while True:
            current = clipboard.paste()
            if tmp != current:
                self.on_change(current)
                tmp = current

if __name__ == "__main__":
    print("foo")
    cw = ClipboadWatcher(on_change=print)
    cw.watch()
